package in.muton.edushare.components.alertpanel.api;

import in.muton.edushare.components.calendar.api.CalendarInterface;

import java.util.Comparator;
import java.util.Date;

import com.edushare.common.vo.Schedules;

public class ScheduleSorter implements Comparator<Schedules> {

	public int compare(Schedules arg0, Schedules arg1) {
		Date d = new Date();
		if(CalendarInterface.getNextOccurence(arg0, d).getTime() >
			CalendarInterface.getNextOccurence(arg1, d).getTime())
			return 1;
		else 
			return -1;
	}

}
